﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductList.ascx.cs" Inherits="Admin_Product_ProductList" %>
<%@ Register Assembly="GroupDropDownList" Namespace="GroupDropDownList" TagPrefix="cc1" %>
<%@ Register Src="~/Admin/Control/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<%@ Import Namespace="WB.Library" %>
<h2>
    Danh sách sản phẩm
</h2>
<div style="margin-bottom: 15px">
    <table width="100%">
        <tr>
            <td width="90px">
                Tên sản phẩm
            </td>
            <td>
                <asp:TextBox ID="txtProductName" runat="server" Width="450px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Loại sản phẩm
            </td>
            <td>
                <cc1:GroupDropDownList ID="ddlCategory" runat="server" Width="200px" AppendDataBoundItems="true">
                    <asp:ListItem Value="">------------- Chọn -------------</asp:ListItem>
                </cc1:GroupDropDownList>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
            
                <asp:Button ID="btnAdd" runat="server" Text="Thêm" onclick="btnAdd_Click"  />
           
                <asp:Button ID="btnSearch" runat="server" Text="Tìm" OnClick="btnSearch_Click" />
            </td>
        </tr>
    </table>
</div>
<table class="table">
    <tr>
        <th width="50px">
            STT
        </th>
        <th>
            Mã sản phẩm
        </th>
        <th width="250px">
            Loại
        </th>
        <th width="120px">
            Giá
        </th>
        <th width="40px">
        </th>
    </tr>
    <asp:Repeater ID="rep" runat="server" onitemcommand="rep_ItemCommand">
        <ItemTemplate>
            <tr>
                <td align="center">
                   <a href='?control=addpro&id=<%# Eval("Id") %>'> <%# Container.ItemIndex+1 %></a>
                </td>
                <td><a href='?control=addpro&id=<%# Eval("Id") %>'>
                    <%# Eval("ProductName_vn") %>
                    </a>
                </td>
                <td>
                    <%--<%# Eval("CatName") %>--%>
                </td>
                <td align="right">
                    <%# FNumber.FormatNumber(Eval("Price")) %>
                </td>
                <td align="center">
                    <asp:LinkButton ID="del" runat="server" CommandName="del" CommandArgument='<%# Eval("Id") %>' OnClientClick="return confirm('Bạn xác nhận xóa dữ liệu?')"><img src="../images/delete.png" /></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</table>
<uc1:Pager ID="ucPager1" runat="server" OnChangePage="OnChangePagging" />
